<!-- POSTS -->

<li id="post-li-<?php  echo $key['id'] ?>" class="hoverList lato  getData " data-expand="<?php echo $_SESSION['LANG']['expand']; ?>" data-hide="<?php echo $_SESSION['LANG']['hide']; ?>" class="" data="<?php echo $key['id']; ?>" data-token="<?php echo $key['token_id']; ?>" data="<?php echo $idPost; ?>" xmlns="http://www.w3.org/1999/html">
    <div class="loading-answer"></div>
	<span class="paddingPost">
		<div class="li-header">
        <?php echo $spanAbsolute; ?>
		<a  href="<?php echo URL_BASE.$key['username']; ?>" data-id="<?php echo $_idUser ?>" class="openModal">
         <?php
         $avatar = $key['avatar'];
         $avatar = _Function::checkExistsAvatar($avatar,'48-48');
            ?>
			<img class="avatar_user" src="<?php echo $avatar ?>">
	      </a>
	<span class="detail_grid">
		<span class="timestamp timeAgo" data="<?php echo date('c', strtotime( $key['date'] ) ); ?>"></span>
<!--		<a  href="--><?php //echo URL_BASE.$key['username']; ?><!--" data-id="--><?php //echo $_idUser ?><!--" class="username openModal">--><?php //echo stripslashes( $key['name'] ).$verified; ?><!-- </a> <strong class="usernameClass">@--><?php //echo $key['username']; ?><!--</strong>-->



        <p class="postTitle">
			<?php
			/*<------- * POST DETAILS * -------->*/
			echo _Function::checkText( $key['post_details'] ); ?>
            <!-- media -->


            <!--end media -->

		</p>

        </div>



		<?php
		if( $key['repost_of_id'] != 0 ) {

			?>
				<p style="font-size: 13px; color: #999; font-style: italic;">
					<img style="vertical-align: middle;" src="<?php echo URL_BASE; ?>public/img/repost-ico.png" /> <?php echo $_SESSION['LANG']['reposted_by']; ?> <?php echo $nameUser; ?>
					</p>
			<?php } ?>

			<!-- EXPAND -->
		<!--	<a  data-expand="<?php echo $_SESSION['LANG']['expand']; ?>" data-hide="<?php echo $_SESSION['LANG']['hide']; ?>" class="expand getData" data="<?php echo $key['id']; ?>" data-token="<?php echo $key['token_id']; ?>">
				<?php echo $icon; ?>
				<span class="textEx"><?php echo $_SESSION['LANG']['expand']; ?></span> <?php echo $typeMedia; ?>
			</a>

			<!-- FAVORITES -->
			<?php if( isset( $_SESSION['authenticated'] ) ): ?>
		<!--	<a data-fav="<?php echo $_SESSION['LANG']['favorite']; ?>" data-fav-active="<?php echo $_SESSION['LANG']['favorited']; ?>" class="favorite favoriteIcon" data="<?php echo $key['id']; ?>" data-token="<?php echo $key['token_id']; ?>">
				<i class="favorite_ico icons<?php echo $iconFav; ?>"></i>
				<span<?php echo $spanFav; ?>><?php echo $textFav; ?></span>
			</a>
			<?php endif; ?>
			<!-- REPOST -->
			<?php if( isset( $_SESSION['authenticated'] ) && $key['user'] !=  $_SESSION['authenticated'] ): ?>
		<!--	<a data-rep="<?php echo $_SESSION['LANG']['repost']; ?>" data-rep-active="<?php echo $_SESSION['LANG']['reposted']; ?>" class="repost_button repostIcon" data="<?php echo $key['id']; ?>" data-token="<?php echo $key['token_id']; ?>">
				<i class="repost_ico icons <?php echo $iconRepost; ?>"></i>
				<span<?php echo $spanRepost; ?>><?php echo $textRepost; ?></span>
			</a>
			<?php endif; ?>
			<!-- TRASH -->
			<?php if( $key['user'] == $_SESSION['authenticated'] ): ?>
		<!--	<a data-message="<?php echo $_SESSION['LANG']['delete_post']; ?>" data-confirm="<?php echo $_SESSION['LANG']['confirm']; ?>" class="trash" data-image="<?php echo $key['photo']; ?>" data="<?php echo $key['id']; ?>" data-token="<?php echo $key['token_id']; ?>">
				<i class="trash_ico icons"></i>
				<span><?php echo $_SESSION['LANG']['trash']; ?></span>
			</a>   -->
			<?php endif; ?>

	<!-- details-post -->
	<span class="details-post">
	</span><!-- details_post -->
	<?php if( isset( $_SESSION['authenticated'] ) ): ?>
	<!-- Grid Reply -->
   <div class="grid-reply <?php echo $key['id'] ?>" style="display: none;">

       <?php

       $getMedia       = $obj->getMedia( $idPost, $token_id );
       if($getMedia[0]['photo']!=''){
           $urlStatus = URL_BASE.'/thumb/300-300-upload/'.$getMedia[0]['photo'];
           $urlOriginal =  URL_BASE.'upload/'.$getMedia[0]['photo'];
           //echo $urlStatus;
           echo ' <a data-view="Details →" data-url="'.$urlDataStatus.'" class="galeryAjax cboxElement" href="'.$urlOriginal.'">
                        <span class="container-media-1">
                        <img style=" margin-top:10px" class="photoPost" src="'.$urlStatus.'">
                        </span>
                    </a>
                    ';
           $urlDataStatus  = $urlStatus = URL_BASE.$getMedia[0]['username'].'/status/'.$getMedia[0]['id'];
       }

       ?>


       <div id="post-replay-<?php echo $key['id'] ?>" class="chart">
           <div class="chart-content">
               <?php
                  
                    include('answer.content.php');
               ?>
           </div>

       </div>

       <ul class="actions_content">
           <li id="chat" class="<?php echo $key['id'] ?>">
               <form action="" method="post" accept-charset="UTF-8" id="form_reply_post">
                   <input type="hidden" name="id_reply" id="id_reply" value="<?php echo $key['id']; ?>">
                   <input type="hidden" name="token_reply" id="token_reply" value="<?php echo $key['token_id']; ?>">
                   <textarea name="reply_post" id="reply_post"></textarea>
                   <div class="counter"></div>
                   <button id="button_reply" disabled="disabled" style="opacity: 0.5; cursor: default;" type="submit"><?php echo $_SESSION['LANG']['reply']; ?></button>
               </form>
               <div class="chat-here">

               </div>
               <span class="loadmore" data-parent="post-li-<?php echo $key['id'] ?>" data-page="2" data-post-id="<?php echo $key['id'] ?>" >Load More</span><div class="search-paging-loading"></div>
           </li>
           <li id="stat">

           </li>
           <li id="voter">

           </li>
       </ul>

       <?php
            $postId = $key['id'];
            $userId = $key['user_id']; //user create
            include('bottomtoolbox.php');
       '' ;
       ?>
       <div class="share_this share-<?=$postId?>" style="float: right;display: none">
          <a href="http://www.facebook.com/sharer/sharer.php?s=100&p[url]=<?php echo 'http://'.$_SERVER['HTTP_HOST'].'/'.$key['username'].'/status/'.$postId; ?>" target="_blank">
                  <span style="background-image: url(http://w.sharethis.com/images/facebook_32.png);display: inline-block;
height: 32px;width: 32px;position: relative;"></span>
          </a>
          <a href="https://twitter.com/home?status=<?='http://'.$_SERVER['HTTP_HOST'].'/'.$key['username'].'/status/'.$postId ?>" target="_blank">
              <span style="background-image: url(http://w.sharethis.com/images/twitter_32.png);display: inline-block;height: 32px;width: 32px;position: relative;"></span>
          </a>

       </div>

	</div><!-- Grid Reply -->

    <?php endif; ?>
  </span><!-- paddingPost  -->
</span>
    <?php
//        $userID = $_SESSION['authenticated'];
////        echo '<pre>';
////        print_r($userInfoCus);
////        echo '</pre>';
    ?>

    <ul class="actions" data-type-account="<?php echo $userInfoCus->type_account ?>" >
        <li data-rel="stat" class="stat"></li>
        <li>
            <a href="<?php echo URL_BASE.$key['username']; ?>"  class="favorite favoriteIcon grey post_action" style="padding-top: 4px">
                <span class="comment_span grey captital">@<?php echo $key['username']; ?> </span>
            </a>
        </li>
        <li title="" data-rel="chat" >
            <div class="getData" data="<?php echo $key['id']; ?>" data-token="<?php echo $key['token_id']; ?>">
                <span class="comment_span grey countreply ">with <?=$countReply[0]['countReply'] ?></span>
                <i class="comment_ico"></i>
            </div>
        </li>
        <li  data-rel="voter">
            <span class="comment_span grey countvote">and <?php echo ($votersCount); ?></span>
            <i class="handle_ico"></i>
        </li>
    </ul>

</li>

